#include<stdio.h>
#include<stdlib.h>
#include<time.h>


int main(int argc,const char* argv[]){
    if(argc != 2){
        return -1;
    }
    FILE*fp = fopen(argv[1],"r");
    if(fp == NULL){
        printf("fopen err\n");
        return -1;
    }
    printf("________fopen success_______\n");

//打印
    char ch1[2]={0,0};
    char ch=0;
    while(ch != -1){
        ch =fgetc(fp);

        if(ch !=-1){
            printf("%c",ch);
        }
    }
    printf("\n");

    if(ferror(fp)){
        perror("err");
    }else if(feof(fp)){
        printf("_______end of file_______\n");
    }

    fclose(fp);
    fp=NULL;
    return 0;
}